var app = getApp()
var util = require('../../../utils/util')
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },
  changeInput(e){
    this.setData({
      [e.currentTarget.dataset.type]:e.detail.value
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onShow: function (options) {
    var that = this;
    wx.request({
      url: app.globalData.urls + '/order-manage/store-info',
      header: app.getRequestHeader(),
      data: {
        bdmin_user_id:util.getBdmin_user_id()
      },
      method:'POST',
      success: function (res) {
        if(res.data.code==200){
          that.setData(res.data.data)
        }
      }
    })
  },
  // 确认修改
  confrim(){
    wx.request({
      url: app.globalData.urls + '/order-manage/edit-store-info',
      header: app.getRequestHeader(),
      data: this.data,
      method:'POST',
      success: function (res) {
        if(res.data.code==200){
          wx.showToast({
            title: '修改成功',
          })
        }else{
          wx.showToast({
            title: res.data.message,
          })
        }
      }
    })
  },
})